document.addEventListener('click', (e) => {
  let {
    target
  } = e

  callbacks.forEach(item => {
    if (item.el === target || item.el.contains(target)) {
      return
    } else {
      item.callback()
    }
  })
})

let callbacks = []

export default {
  created: function (el, binding) {
    callbacks.push({
      el,
      callback: binding.value
    })

  }
}